<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改环境配置')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-config-edit" th:object="${coverageEnvConfig}">
        <input name="configId" th:field="*{configId}" type="hidden">
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">客户端名称：</label>
                <div class="col-sm-8">
                    <input name="clientName" th:field="*{clientName}" class="form-control" type="text">
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">应用名称：</label>
                <div class="col-sm-8">
                    <input name="appName" th:field="*{appName}" class="form-control" type="text">
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">ip地址：</label>
                <div class="col-sm-8">
                    <input name="ip" th:field="*{ip}" class="form-control" type="text">
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">端口：</label>
                <div class="col-sm-8">
                    <input name="port" th:field="*{port}" class="form-control" type="text">
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">仓库地址：</label>
                <div class="col-sm-8">
                    <input name="repositoryUrl" th:field="*{repositoryUrl}" class="form-control" type="text">
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">用户名：</label>
                <div class="col-sm-8">
                    <input name="name" th:field="*{name}" class="form-control" type="text">
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">密码：</label>
                <div class="col-sm-8">
                    <input name="password" th:field="*{password}" class="form-control" type="text">
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">起始版本：</label>
                <div class="col-sm-8">
                    <input name="versionStart" th:field="*{versionStart}" class="form-control" type="text">
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">当前版本：</label>
                <div class="col-sm-8">
                    <input name="versionNow" th:field="*{versionNow}" class="form-control" type="text">
                </div>
            </div>
        </div>

        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">覆盖率类型：</label>
                <div class="col-sm-8">
                    <select name="coverageType" class="form-control m-b"
                            th:with="type=${@dict.getType('coverage_type')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
                                th:field="*{coverageType}"></option>
                    </select>
                </div>
            </div>

            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">源码相对路径：</label>
                    <div class="col-sm-8">
                        <input name="versionNow" th:field="*{sourceFiles}" class="form-control" type="text">
                    </div>
                </div>
            </div>

            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">class文件相对路径：</label>
                    <div class="col-sm-8">
                        <input name="versionNow" th:field="*{classFiles}" class="form-control" type="text">
                    </div>
                </div>
            </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var prefix = ctx + "server/config";
    $("#form-config-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-config-edit').serialize());
        }
    }
</script>
</body>
</html>